import 'package:json_annotation/json_annotation.dart';

part 'cartoon_model.g.dart';


@JsonSerializable()
class CartoonModel extends Object {

  @JsonKey(name: 'id')
  String id;

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'summary')
  String summary;

  @JsonKey(name: 'avatar')
  String avatar;

  @JsonKey(name: 'banner')
  String? banner;

  @JsonKey(name: 'useNum')
  int? useNum;

  @JsonKey(name: 'tplNum')
  int? tplNum;

  @JsonKey(name: 'fansNum')
  int? fansNum;

  @JsonKey(name: 'hasFollow')
  int? hasFollow;

  @JsonKey(name: 'user')
  User? user;

  @JsonKey(name: 'pipeList')
  List<PipeList>? pipeList;

  CartoonModel(this.id,this.name,this.summary,this.avatar,this.banner,this.useNum,this.tplNum,this.fansNum,this.hasFollow,this.user,this.pipeList,);

  factory CartoonModel.fromJson(Map<String, dynamic> srcJson) => _$CartoonModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CartoonModelToJson(this);

}


@JsonSerializable()
class User extends Object {

  @JsonKey(name: 'id')
  String id;

  @JsonKey(name: 'uid')
  String uid;

  @JsonKey(name: 'nickname')
  String nickname;

  @JsonKey(name: 'avatar')
  String avatar;

  User(this.id,this.uid,this.nickname,this.avatar,);

  factory User.fromJson(Map<String, dynamic> srcJson) => _$UserFromJson(srcJson);

  Map<String, dynamic> toJson() => _$UserToJson(this);

}


@JsonSerializable()
class PipeList extends Object {

  @JsonKey(name: 'id')
  String id;

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'cover')
  String cover;

  @JsonKey(name: 'summary')
  String? summary;

  @JsonKey(name: 'useNum')
  int useNum;

  PipeList(this.id,this.name,this.cover,this.summary,this.useNum,);

  factory PipeList.fromJson(Map<String, dynamic> srcJson) => _$PipeListFromJson(srcJson);

  Map<String, dynamic> toJson() => _$PipeListToJson(this);

}


